<template>
  <div>
    <el-button type="primary" @click="willAdd">添加</el-button>
    <v-list :user="user" :flag="flag"></v-list>
    <v-form :flag="flag" :user="user" ref="form"></v-form>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import vList from "./components/list.vue";
import vForm from "./components/form.vue";
import addEdit from "../../mixins/addEdit" 

export default {
  data() {
    return {
      user:{size:5,page:1}
    };
  },
  mixins:[addEdit],
  props: [],
  components: {
    vList,
    vForm
  },
  computed: {
    ...mapGetters({
      userCount: "manage/userCount",
      userList: "manage/userList",
      userInfo: "manage/userInfo",
    })
  },
  methods: {
    ...mapActions({
      reqUserCount: "manage/reqUserCount",
      reqUserList: "manage/reqUserList",
      reqUserInfo: "manage/reqUserInfo",
      reqRoleList: "manage/reqRoleList",
    })
  },
  mounted() {
    this.reqRoleList()
    this.reqUserList(this.user)
    this.reqUserCount()
  }
};
</script>
<style lang="less" scoped>
.el-button{
  margin: 20px 0;
}
</style>